package com.example.com.skills_utf8;

import com.utils.Utils1;

import view.ScrollLayout;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;



// 对于左侧还有,大可以采取SlidingMenu的策略
public class UseScrollLayoutActivity extends Activity{

	
	UseScrollLayoutActivity activity = this;
	
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		
		
		setContentView(R.layout.activity_use_scroll_layout);
		
		
		final ScrollLayout scroll_layout =(ScrollLayout)findViewById(R.id.scroll_layout);
		Button btn_1 = (Button)findViewById(R.id.btn_1);
		Button btn_2 = (Button)findViewById(R.id.btn_2);
		Button btn_3 = (Button)findViewById(R.id.btn_3);
		
	//	scroll_layout.setIsScroll(false);
		
		btn_1.setOnClickListener( new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				scroll_layout.snapToScreen(0);
			}
		});

		btn_2.setOnClickListener( new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				int[] size =Utils1.getScreenSize(activity);
				scroll_layout.snapToScreen(1, -size[0]/4);
			}
		});
		
	///*	
		btn_3.setOnClickListener( new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				int[] size =Utils1.getScreenSize(activity);
				scroll_layout.snapToScreen(2, 0);
			}
		});
		//*/
		
		
	}
}
